home *** CD-ROM | disk | FTP | other *** search
/ Matinee Screensaver / Matinee Screen Saver.iso / matinee.mst < prev    next >
Text File  |  1993-06-13  |  16KB  |  712 lines

  1. '$define debug
  2.  
  3. '$include 'setupapi.inc'
  4. '$include 'msdetect.inc'
  5.  
  6. ''Standard Dialog ID's : Make sure these are consistent with STDCUI.H file.
  7.  
  8. const WELCOME = 100
  9. const ASKQUIT = 200
  10. const DESTPATH = 300
  11. const EXITQUIT = 600
  12. const EXITSUCCESS = 700
  13.  
  14. ''Custom Dialog ID's : Make sure these are consistent with CUIDLG.H file.
  15.  
  16. const SELECTMODE = 6201
  17. const SELECTCHIP = 6202
  18. const SELECTSIZE = 6203
  19. const TOOBIG = 6204
  20. const SELECTCLIPS = 6205
  21.  
  22. '' Error IDs
  23.  
  24. const ERR_BADVGAMODE = 8000
  25. const ERR_BADCPU = 8001
  26. const ERR_BADWINDOWSPATH = 8000
  27. const ERR_BADPATH = 8000
  28.  
  29. ''Bitmap ID
  30.  
  31. const LOGO = 6101
  32.  
  33. ''Chip sets : Make sure these are consistent with the WhatVga DLL
  34.  
  35. const CIRRUS = 100
  36. const EVEREX = 101
  37. const PARADISE = 102
  38. const TSENG = 103
  39. const TRIDENT = 104
  40. const T8900 = 105
  41. const ATIVGA = 106
  42. const AHEADA = 107
  43. const AHEADB = 108
  44. const OAKTECH = 109
  45. const VIDEO7 = 110
  46. const CHIPSTECH = 111
  47. const TSENG4 = 112
  48. const GENOA = 113
  49. const NCR = 114
  50. const COMPAQ = 115
  51. const UNKNOWN = -1
  52.  
  53. ''User interface DLL name
  54.  
  55. const UIDll$ = "cui.dll"
  56.  
  57. ''Constants for functions
  58.  
  59. ''GetProcessor
  60.  
  61. const IS386 = 3
  62.  
  63. ''GetDeviceCaps
  64.  
  65. const NUMCOLORS = 24
  66. const SIZEPALETTE = 104
  67.  
  68. '' Global variable declaration
  69.  
  70. global MatineePath$     ''Default destination directory.
  71. global WindowsDir$      ''Windows directory.
  72. global MatineeIniPath$  ''Path to the INI file to be used
  73.  
  74. '' functions/procedure declaration
  75.  
  76. declare sub ConfirmQuit
  77. declare function MakePath (szDir$, szFile$) as string
  78. declare function GetColors() as integer
  79.  
  80. '' External function/procedure declaration
  81.  
  82. declare function GetDC lib "USER.EXE" (hwnd%) as integer 
  83. declare function ReleaseDC lib "USER.EXE" (hwnd%, hdc%) as integer
  84. declare function GetDeviceCaps lib "GDI.EXE" (hdc%, iCapabilities%) as integer
  85.  
  86. Init:    '' Start here
  87.  
  88.     '' Set up the error traps
  89.  
  90.     on error goto HandleError
  91.  
  92.     '' Set up the way the install program looks
  93.  
  94.     SetBitmap UIDll$, LOGO
  95.     SetTitle "Matinee version 1.0R CD-ROM Setup"
  96.  
  97.     '' Make sure proper hardware is there
  98.  
  99.     if GetProcessorType() < IS386 then
  100.  
  101.         '' We aren't on a 386 or above. FATAL!
  102.  
  103.         error ERR_BADCPU
  104.  
  105.     end if
  106.  
  107.     i% = GetColors()
  108.  
  109.     if i% <= 16 then
  110.  
  111.         '' make sure we didn't just wrap around...
  112.  
  113.         if i% > 0 then
  114.  
  115.             '' We don't have a VGA driver with 256 colors
  116.             '' installed. FATAL!
  117.  
  118.             error ERR_BADVGAMODE
  119.  
  120.         end if
  121.  
  122.     end if
  123.  
  124.     '' Find the INF file
  125.  
  126.     szInfPath$ = GetSymbolValue("STF_SRCINFPATH")
  127.     if szInfPath$ = "" then
  128.         '' No predefined path for INF file, so just assume it is in
  129.         '' the current directory.
  130.  
  131.         szInfPath$ = GetSymbolValue("STF_CWDDIR") + "MATINEE.INF"
  132.     end if
  133.  
  134.     '' Load in the INF file
  135.  
  136.     ReadInfFile szInfPath$
  137.  
  138.     '' Set the size checking mode
  139.  
  140.     i% = SetSizeCheckMode(scmOnIgnore)
  141.  
  142.     '' Check that windows diectory is writable
  143.  
  144.     WindowsDir$ = GetWindowsDir()
  145.     i% = IsDirWritable(WindowsDir$)
  146.     if i% = 0 then
  147.  
  148.         '' Error: can't write to windows directory. exit.
  149.  
  150.         error ERR_BADWINDOWSPATH
  151.  
  152.     endif
  153.  
  154.     '' setup the ini path
  155.  
  156.     MatineeIniPath$ = MakePath(WindowsDir$, "CONTROL.INI")
  157.  
  158. DOWELCOME:
  159.  
  160.     sz$ = UIStartDlg(UIDll$, WELCOME, "FInfoDlgProc", 0, "")
  161.     if sz$ = "CONTINUE" then
  162.         UIPop 1
  163.     else
  164.         ConfirmQuit
  165.         goto DOWELCOME
  166.     end if
  167.  
  168.     '' Do the main thing
  169.  
  170. GETPATH:
  171.  
  172.     '' Set up symbols as parameters for dialog box
  173.  
  174.     SetSymbolValue "EditTextIn", "C:\MATINEE"
  175.     SetSymbolValue "EditFocus", "ALL"
  176.  
  177. GETPATHL1:
  178.  
  179.     sz$ = UIStartDlg(UIDll$, DESTPATH, "FEditDlgProc", 0, "")
  180.     MatineePath$ = GetSymbolValue("EditTextOut")
  181.  
  182.     if sz$ = "CONTINUE" then
  183.  
  184.         '' Make sure our target is writable
  185.  
  186.         if IsDirWritable(MatineePath$) = 0 then
  187.  
  188.             error ERR_BADPATH
  189.             goto GETPATHL1
  190.  
  191.         end if
  192.  
  193.         UIPop 1
  194.  
  195.     elseif sz$ = "REACTIVATE" then
  196.         goto GETPATHL1
  197.     else
  198.         ConfirmQuit
  199.         goto GETPATH
  200.     end if
  201.  
  202.     '' Set up the defaults before video DLL selection
  203.  
  204.     VgaType$ = "dib"
  205.     IsDIB$ = "1"
  206.  
  207.     '' select whether or not to set up chip sets
  208.  
  209. SELECTSETUPMODE:
  210.  
  211.     SetSymbolValue "RadioDefault", "1"
  212.  
  213. SELECTSETUPMODEL1:
  214.  
  215.     sz$ = UIStartDlg(UIDll$, SELECTMODE, "FRadioDlgProc", 0, "")
  216.     NewMode% = val(GetSymbolValue("ButtonChecked"))
  217.  
  218.     if sz$ = "CONTINUE" then
  219.  
  220.         UIPop 1
  221.  
  222.     elseif sz$ = "REACTIVATE" then 
  223.  
  224.         goto SELECTSETUPMODEL1
  225.  
  226.     elseif sz$ = "BACK" then 
  227.  
  228.         UIPop 1
  229.         goto GETPATH
  230.          
  231.     else
  232.  
  233.         ConfirmQuit
  234.         goto SELECTSETUPMODE
  235.  
  236.     end if
  237.  
  238.     select case NewMode%
  239.         case 2
  240.             '' Select Expert mode
  241.  
  242.             SetupMode% = 0
  243.  
  244.         case else
  245.             '' Select Normal mode
  246.  
  247.             SetupMode% = 1
  248.     end select
  249.  
  250.     if SetupMode% = 1 then
  251.     
  252.         goto SKIPCHIPSELECT
  253.  
  254.     end if
  255.  
  256.     '' Set up variables for chip select dialog
  257.  
  258.     VideoType = -1
  259.     Index$ = "6"
  260.  
  261. GETTYPE:
  262.  
  263.     '' select the chip type
  264.  
  265.     SetSymbolValue "RadioDefault", Index$
  266.  
  267. GETTYPEL1:
  268.  
  269.     sz$ = UIStartDlg(UIDll$, SELECTCHIP, "FRadioDlgProc", 0, "")
  270.     NewIndex% = val(GetSymbolValue("ButtonChecked"))
  271.  
  272.     if sz$ = "CONTINUE" then
  273.  
  274.         UIPop 1
  275.  
  276.     elseif sz$ = "REACTIVATE" then 
  277.  
  278.         goto GETTYPEL1
  279.  
  280.     elseif sz$ = "BACK" then 
  281.  
  282.         UIPop 1
  283.         goto SELECTSETUPMODE
  284.          
  285.     else
  286.  
  287.         ConfirmQuit
  288.         goto GETTYPE
  289.  
  290.     end if
  291.  
  292.     Index$ = str$(NewIndex%)
  293.  
  294.     select case NewIndex%
  295.         case 1
  296.             IsDIB$ = "0"
  297.             VgaType$ = "tsg"
  298.         case 2
  299.             IsDIB$ = "0"
  300.             VgaType$ = "tri"
  301.         case 3
  302.             IsDIB$ = "0"
  303.             VgaType$ = "v7"
  304.         case 4
  305.             IsDIB$ = "0"
  306.             VgaType$ = "cir"
  307.         case 5
  308.             IsDIB$ = "0"
  309.             VgaType$ = "cpq"
  310.         case else
  311.             IsDIB$ = "1"
  312.             VgaType$ = "dib"
  313.     end select
  314.  
  315. SKIPCHIPSELECT:
  316.  
  317.     '' Determine the speed of the machine. For the moment ignore this and
  318.     '' just use default for rate and simple size selection
  319.  
  320.     '' default for speed
  321.  
  322.     Rate$ = "30"
  323.  
  324.     '' select the size of the player
  325.  
  326.     if VgaType$ = "dib" then
  327.  
  328.         Size$ = "160"
  329.         Small$ = "1"
  330.         Index2$ = "2"
  331.  
  332.     else
  333.  
  334.         Size$ = "320"
  335.         Small$ = "0"
  336.         Index2$ = "1"
  337.  
  338.     end if
  339.  
  340. GETSIZE:
  341.  
  342.     SetSymbolValue "RadioDefault", Index2$
  343.  
  344. GETSIZEL1:
  345.  
  346.     sz$ = UIStartDlg(UIDll$, SELECTSIZE, "FRadioDlgProc", 0, "")
  347.     NewIndex% = val(GetSymbolValue("ButtonChecked"))
  348.  
  349.     if sz$ = "CONTINUE" then
  350.  
  351.         UIPop 1
  352.  
  353.     elseif sz$ = "REACTIVATE" then
  354.  
  355.         goto GETSIZEL1
  356.  
  357.     elseif sz$ = "BACK" then
  358.  
  359.         UIPop 1
  360.         if SetupMode% = 0 then
  361.             goto GETTYPE
  362.         else
  363.             goto SELECTSETUPMODE
  364.         end if
  365.     else
  366.  
  367.         ConfirmQuit
  368.         goto GETSIZE
  369.  
  370.     end if
  371.  
  372.     select case NewIndex%
  373.         case 1
  374.             Small$ = "0"
  375.             Size$ = "320"
  376.         case else
  377.             Small$ = "1"
  378.             Size$ = "160"
  379.     end select
  380.  
  381. STARTCOPYING:
  382.  
  383.     '' prepare directories
  384.  
  385.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  386.     CreateDir MatineePath$, cmoNone
  387.  
  388. SELECTCLIPSTOCOPY:
  389.  
  390.     CheckStates$ = "CheckItemsIn"
  391.  
  392.     for i% = 1 to 10 step 1
  393.  
  394.         AddListItem CheckStates$, "ON"
  395.  
  396.     next i%
  397.  
  398. SELECTCLIPSTOCOPYL1:
  399.  
  400.     sz$ = UIStartDlg(UIDll$, SELECTCLIPS, "FCheckDlgProc", 0, "")
  401.  
  402.     if sz$ = "CONTINUE" then
  403.  
  404.         UIPop 1
  405.  
  406.     elseif sz$ = "REACTIVATE" then
  407.  
  408.         goto SELECTCLIPSTOCOPYL1
  409.  
  410.     elseif sz$ = "BACK" then
  411.  
  412.         UIPop 1
  413.         goto GETSIZE
  414.     else
  415.  
  416.         ConfirmQuit
  417.         goto SELECTCLIPSTOCOPY
  418.  
  419.     end if
  420.  
  421.     for i% = 1 to 10 step 1
  422.  
  423.         sz$ = GetListItem("CheckItemsOut", i%)
  424.         
  425.         select case i%
  426.             case 1
  427.                 if sz$ = "ON" then
  428.  
  429.                     AddSectionFilesToCopyList "Psychedelic", SrcDir$, MatineePath$
  430.                     
  431.                 end if
  432.             case 2
  433.                 if sz$ = "ON" then
  434.  
  435.                     AddSectionFilesToCopyList "Space", SrcDir$, MatineePath$
  436.                     
  437.                 end if
  438.             case 3
  439.                 if sz$ = "ON" then
  440.  
  441.                     AddSectionFilesToCopyList "Nature", SrcDir$, MatineePath$
  442.                     
  443.                 end if
  444.             case 4
  445.                 if sz$ = "ON" then
  446.  
  447.                     AddSectionFilesToCopyList "Monsters", SrcDir$, MatineePath$
  448.                     
  449.                 end if
  450.             case 5
  451.                 if sz$ = "ON" then
  452.  
  453.                     AddSectionFilesToCopyList "Sports", SrcDir$, MatineePath$
  454.                     
  455.                 end if
  456.             case 6
  457.                 if sz$ = "ON" then
  458.  
  459.                     AddSectionFilesToCopyList "Humor", SrcDir$, MatineePath$
  460.                     
  461.                 end if
  462.             case 7
  463.                 if sz$ = "ON" then
  464.  
  465.                     AddSectionFilesToCopyList "Cartoons", SrcDir$, MatineePath$
  466.                     
  467.                 end if
  468.             case 8
  469.                 if sz$ = "ON" then
  470.  
  471.                     AddSectionFilesToCopyList "Bodies", SrcDir$, MatineePath$
  472.                     
  473.                 end if
  474.             case 9
  475.                 if sz$ = "ON" then
  476.  
  477.